1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19 
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 
25 module adw.CarouselIndicatorDots;
26 
27 private import adw.Carousel;
28 private import adw.c.functions;
29 public  import adw.c.types;
30 private import glib.ConstructionException;
31 private import gobject.ObjectG;
32 private import gtk.AccessibleIF;
33 private import gtk.AccessibleT;
34 private import gtk.BuildableIF;
35 private import gtk.BuildableT;
36 private import gtk.ConstraintTargetIF;
37 private import gtk.ConstraintTargetT;
38 private import gtk.OrientableIF;
39 private import gtk.OrientableT;
40 private import gtk.Widget;
41 
42 
43 /**
44  * A dots indicator for [class@Carousel].
45  * 
46  * <picture>
47  * <source srcset="carousel-indicator-dots-dark.png" media="(prefers-color-scheme: dark)">
48  * <img src="carousel-indicator-dots.png" alt="carousel-indicator-dots">
49  * </picture>
50  * 
51  * The `AdwCarouselIndicatorDots` widget shows a set of dots for each page of a
52  * given [class@Carousel]. The dot representing the carousel's active page is
53  * larger and more opaque than the others, the transition to the active and
54  * inactive state is gradual to match the carousel's position.
55  * 
56  * See also [class@CarouselIndicatorLines].
57  * 
58  * ## CSS nodes
59  * 
60  * `AdwCarouselIndicatorDots` has a single CSS node with name
61  * `carouselindicatordots`.
62  *
63  * Since: 1.0
64  */
65 public class CarouselIndicatorDots : Widget, OrientableIF
66 {
67 	/** the main Gtk struct */
68 	protected AdwCarouselIndicatorDots* adwCarouselIndicatorDots;
69 
70 	/** Get the main Gtk struct */
71 	public AdwCarouselIndicatorDots* getCarouselIndicatorDotsStruct(bool transferOwnership = false)
72 	{
73 		if (transferOwnership)
74 			ownedRef = false;
75 		return adwCarouselIndicatorDots;
76 	}
77 
78 	/** the main Gtk struct as a void* */
79 	protected override void* getStruct()
80 	{
81 		return cast(void*)adwCarouselIndicatorDots;
82 	}
83 
84 	/**
85 	 * Sets our main struct and passes it to the parent class.
86 	 */
87 	public this (AdwCarouselIndicatorDots* adwCarouselIndicatorDots, bool ownedRef = false)
88 	{
89 		this.adwCarouselIndicatorDots = adwCarouselIndicatorDots;
90 		super(cast(GtkWidget*)adwCarouselIndicatorDots, ownedRef);
91 	}
92 
93 	// add the Orientable capabilities
94 	mixin OrientableT!(AdwCarouselIndicatorDots);
95 
96 
97 	/** */
98 	public static GType getType()
99 	{
100 		return adw_carousel_indicator_dots_get_type();
101 	}
102 
103 	/**
104 	 * Creates a new `AdwCarouselIndicatorDots`.
105 	 *
106 	 * Returns: the newly created `AdwCarouselIndicatorDots`
107 	 *
108 	 * Since: 1.0
109 	 *
110 	 * Throws: ConstructionException GTK+ fails to create the object.
111 	 */
112 	public this()
113 	{
114 		auto __p = adw_carousel_indicator_dots_new();
115 
116 		if(__p is null)
117 		{
118 			throw new ConstructionException("null returned by new");
119 		}
120 
121 		this(cast(AdwCarouselIndicatorDots*) __p);
122 	}
123 
124 	/**
125 	 * Gets the displayed carousel.
126 	 *
127 	 * Returns: the displayed carousel
128 	 *
129 	 * Since: 1.0
130 	 */
131 	public Carousel getCarousel()
132 	{
133 		auto __p = adw_carousel_indicator_dots_get_carousel(adwCarouselIndicatorDots);
134 
135 		if(__p is null)
136 		{
137 			return null;
138 		}
139 
140 		return ObjectG.getDObject!(Carousel)(cast(AdwCarousel*) __p);
141 	}
142 
143 	/**
144 	 * Sets the displayed carousel.
145 	 *
146 	 * Params:
147 	 *     carousel = a carousel
148 	 *
149 	 * Since: 1.0
150 	 */
151 	public void setCarousel(Carousel carousel)
152 	{
153 		adw_carousel_indicator_dots_set_carousel(adwCarouselIndicatorDots, (carousel is null) ? null : carousel.getCarouselStruct());
154 	}
155 }